Remove the deprecated region APIs completely from GTK.
https://bugzilla.gnome.org/show_bug.cgi?id=613284
gdkinternals.h \
gdkprivate.h \
gdkpoly-generic.h \
- gdkregion-generic.h \
keyname-table.h \
win32 \
directfb \
gdk_rectangle_intersect
gdk_rectangle_union
-<SUBSECTION>
-GdkRegion
-gdk_region_new
-gdk_region_polygon
-GdkFillRule
-gdk_region_copy
-gdk_region_rectangle
-gdk_region_destroy
-
-<SUBSECTION>
-gdk_region_get_clipbox
-gdk_region_get_rectangles
-gdk_region_empty
-gdk_region_equal
-gdk_region_rect_equal
-gdk_region_point_in
-gdk_region_rect_in
-GdkOverlapType
-
-<SUBSECTION>
-gdk_region_offset
-gdk_region_shrink
-gdk_region_union_with_rect
-gdk_region_intersect
-gdk_region_union
-gdk_region_subtract
-gdk_region_xor
-
-<SUBSECTION>
-GdkSpan
-GdkSpanFunc
-gdk_region_spans_intersect_foreach
-
-<SUBSECTION Standard>
-GDK_TYPE_OVERLAP_TYPE
-GDK_TYPE_RECTANGLE
-
<SUBSECTION Private>
gdk_rectangle_get_type
</SECTION>
@Returns:
+<!-- ##### FUNCTION gdk_image_get_pixels ##### -->
+<para>
+
+</para>
+
+@image:
+@Returns:
+
+
<!-- ##### FUNCTION gdk_image_put_pixel ##### -->
<para>
Sets a pixel in a #GdkImage to a given pixel value.
<!-- ##### SECTION Title ##### -->
-Points, Rectangles and Regions
+Points and Rectangles
<!-- ##### SECTION Short_Description ##### -->
Simple graphical data types
<!-- ##### SECTION Long_Description ##### -->
<para>
-GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data types
-for representing pixels and sets of pixels on the screen.
+GDK provides the #GdkPoint and #GdkRectangle data types for representing pixels
+and sets of pixels on the screen. Together with Cairo's #cairo_region_t data
+type, they make up the central types for representing graphical data.
</para>
<para>
#GdkPoint is a simple structure containing an x and y coordinate of a point.
gdk_rectangle_union().
</para>
<para>
-#GdkRegion is an opaque data type holding a set of arbitrary pixels, and is
-usually used for clipping graphical operations (see gdk_gc_set_clip_region()).
-</para>
-<para>
-#GdkSpan is a structure holding a spanline. A spanline is a horizontal line that
-is one pixel wide. It is mainly used when rasterizing other graphics primitives.
-It can be intersected to regions by using gdk_region_spans_intersect_foreach().
+#cairo_region_t is usually used for managing clipping of graphical operations.
</para>
<!-- ##### SECTION See_Also ##### -->
@dest:
-<!-- ##### STRUCT GdkRegion ##### -->
-<para>
-A GdkRegion represents a set of pixels on the screen.
-</para>
-
-
-<!-- ##### FUNCTION gdk_region_new ##### -->
-<para>
-
-</para>
-
-@void:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_polygon ##### -->
-<para>
-
-</para>
-
-@points:
-@n_points:
-@fill_rule:
-@Returns:
-
-
-<!-- ##### ENUM GdkFillRule ##### -->
-<para>
-The method for determining which pixels are included in a region, when
-creating a #GdkRegion from a polygon.
-The fill rule is only relevant for polygons which overlap themselves.
-</para>
-
-@GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times are
-included in the region, while areas overlapped an even number of times are not.
-@GDK_WINDING_RULE: overlapping areas are always included.
-
-<!-- ##### FUNCTION gdk_region_copy ##### -->
-<para>
-
-</para>
-
-@region:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_rectangle ##### -->
-<para>
-
-</para>
-
-@rectangle:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_destroy ##### -->
-<para>
-
-</para>
-
-@region:
-
-
-<!-- ##### FUNCTION gdk_region_get_clipbox ##### -->
-<para>
-
-</para>
-
-@region:
-@rectangle:
-
-
-<!-- ##### FUNCTION gdk_region_get_rectangles ##### -->
-<para>
-
-</para>
-
-@region:
-@rectangles:
-@n_rectangles:
-
-
-<!-- ##### FUNCTION gdk_region_empty ##### -->
-<para>
-
-</para>
-
-@region:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_equal ##### -->
-<para>
-
-</para>
-
-@region1:
-@region2:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_rect_equal ##### -->
-<para>
-
-</para>
-
-@region:
-@rectangle:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_point_in ##### -->
-<para>
-
-</para>
-
-@region:
-@x:
-@y:
-@Returns:
-
-
-<!-- ##### FUNCTION gdk_region_rect_in ##### -->
-<para>
-
-</para>
-
-@region:
-@rectangle:
-@Returns:
-
-
-<!-- ##### ENUM GdkOverlapType ##### -->
-<para>
-Specifies the possible values returned by gdk_region_rect_in().
-</para>
-
-@GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.
-@GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.
-@GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.
-
-<!-- ##### FUNCTION gdk_region_offset ##### -->
-<para>
-
-</para>
-
-@region:
-@dx:
-@dy:
-
-
-<!-- ##### FUNCTION gdk_region_shrink ##### -->
-<para>
-
-</para>
-
-@region:
-@dx:
-@dy:
-
-
-<!-- ##### FUNCTION gdk_region_union_with_rect ##### -->
-<para>
-
-</para>
-
-@region:
-@rect:
-
-
-<!-- ##### FUNCTION gdk_region_intersect ##### -->
-<para>
-</para>
-
-@source1:
-@source2:
-
-
-<!-- ##### FUNCTION gdk_region_union ##### -->
-<para>
-
-</para>
-
-@source1:
-@source2:
-
-
-<!-- ##### FUNCTION gdk_region_subtract ##### -->
-<para>
-</para>
-
-@source1:
-@source2:
-
-
-<!-- ##### FUNCTION gdk_region_xor ##### -->
-<para>
-</para>
-
-@source1:
-@source2:
-
-
-<!-- ##### STRUCT GdkSpan ##### -->
-<para>
-A GdkSpan represents a horizontal line of pixels starting
-at the pixel with coordinates @x, @y and ending before @x + @width, @y.
-</para>
-
-@x: x coordinate of the first pixel.
-@y: y coordinate of the first pixel.
-@width: number of pixels in the span.
-
-<!-- ##### USER_FUNCTION GdkSpanFunc ##### -->
-<para>
-This defines the type of the function passed to
-gdk_region_spans_intersect_foreach().
-</para>
-
-@span: a #GdkSpan.
-@data: the user data passed to gdk_region_spans_intersect_foreach().
-
-
-<!-- ##### FUNCTION gdk_region_spans_intersect_foreach ##### -->
-<para>
-
-</para>
-
-@region:
-@spans:
-@n_spans:
-@sorted:
-@function:
-@data:
-
-
@Returns:
+<!-- ##### FUNCTION gtk_button_get_event_window ##### -->
+<para>
+
+</para>
+
+@button:
+@Returns:
+
+
@calendar:
@month:
@year:
-@Returns:
<!-- ##### FUNCTION gtk_calendar_select_day ##### -->
@calendar:
@day:
-@Returns:
<!-- ##### FUNCTION gtk_calendar_unmark_day ##### -->
@calendar:
@day:
-@Returns:
<!-- ##### FUNCTION gtk_calendar_clear_marks ##### -->
@GTK_ENTRY_ICON_PRIMARY: At the beginning of the entry (depending on the text direction).
@GTK_ENTRY_ICON_SECONDARY: At the end of the entry (depending on the text direction).
-
@Since: 2.16
<!-- ##### FUNCTION gtk_entry_set_icon_from_pixbuf ##### -->
@Returns:
+<!-- ##### FUNCTION gtk_font_selection_dialog_get_font_selection ##### -->
+<para>
+
+</para>
+
+@fsd:
+@Returns:
+
+
@Returns:
+<!-- ##### FUNCTION gtk_icon_info_load_symbolic_for_style ##### -->
+<para>
+
+</para>
+
+@icon_info:
+@style:
+@state:
+@was_symbolic:
+@error:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_icon_info_set_raw_coordinates ##### -->
<para>
@Returns:
-<!-- ##### FUNCTION gtk_notebook_query_tab_label_packing ##### -->
-<para>
-</para>
-
-@notebook:
-@child:
-@expand:
-@fill:
-@pack_type:
-
-
<!-- ##### FUNCTION gtk_notebook_set_menu_label ##### -->
<para>
</para>
@tab_label:
-<!-- ##### FUNCTION gtk_notebook_set_tab_label_packing ##### -->
-<para>
-</para>
-
-@notebook:
-@child:
-@expand:
-@fill:
-@pack_type:
-
-
<!-- ##### FUNCTION gtk_notebook_set_tab_label_text ##### -->
<para>
</para>
</para>
+<!-- ##### ARG GtkProgressBar:show-text ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkProgressBar:text ##### -->
<para>
@pbar:
-<!-- ##### FUNCTION gtk_progress_bar_set_text ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_set_fraction ##### -->
<para>
</para>
@pbar:
-@text:
+@fraction:
-<!-- ##### FUNCTION gtk_progress_bar_set_fraction ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_get_fraction ##### -->
<para>
</para>
@pbar:
-@fraction:
+@Returns:
-<!-- ##### FUNCTION gtk_progress_bar_set_pulse_step ##### -->
+<!-- ##### ENUM GtkProgressBarOrientation ##### -->
<para>
-
+An enumeration representing possible orientations and growth
+directions for the visible progress bar.
</para>
-@pbar:
-@fraction:
-
+@GTK_PROGRESS_LEFT_TO_RIGHT: A horizontal progress bar growing from left to right.
+@GTK_PROGRESS_RIGHT_TO_LEFT: A horizontal progress bar growing from right to left.
+@GTK_PROGRESS_BOTTOM_TO_TOP: A vertical progress bar growing from bottom to top.
+@GTK_PROGRESS_TOP_TO_BOTTOM: A vertical progress bar growing from top to bottom.
<!-- ##### FUNCTION gtk_progress_bar_set_orientation ##### -->
<para>
@orientation:
-<!-- ##### FUNCTION gtk_progress_bar_set_ellipsize ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_get_orientation ##### -->
<para>
</para>
@pbar:
-@mode:
+@Returns:
-<!-- ##### ENUM GtkProgressBarOrientation ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_set_show_text ##### -->
<para>
-An enumeration representing possible orientations and growth
-directions for the visible progress bar.
+
</para>
-@GTK_PROGRESS_LEFT_TO_RIGHT: A horizontal progress bar growing from left to right.
-@GTK_PROGRESS_RIGHT_TO_LEFT: A horizontal progress bar growing from right to left.
-@GTK_PROGRESS_BOTTOM_TO_TOP: A vertical progress bar growing from bottom to top.
-@GTK_PROGRESS_TOP_TO_BOTTOM: A vertical progress bar growing from top to bottom.
+@pbar:
+@show_text:
-<!-- ##### FUNCTION gtk_progress_bar_get_text ##### -->
+
+<!-- ##### FUNCTION gtk_progress_bar_get_show_text ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gtk_progress_bar_get_fraction ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_set_text ##### -->
<para>
</para>
@pbar:
-@Returns:
+@text:
-<!-- ##### FUNCTION gtk_progress_bar_get_pulse_step ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_get_text ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gtk_progress_bar_get_orientation ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_set_ellipsize ##### -->
<para>
</para>
@pbar:
-@Returns:
+@mode:
<!-- ##### FUNCTION gtk_progress_bar_get_ellipsize ##### -->
@Returns:
-<!-- ##### ENUM GtkProgressBarStyle ##### -->
+<!-- ##### FUNCTION gtk_progress_bar_set_pulse_step ##### -->
<para>
-An enumeration representing the styles for drawing the progress bar.
+
</para>
-@GTK_PROGRESS_CONTINUOUS: The progress bar grows in a smooth, continuous manner.
-@GTK_PROGRESS_DISCRETE: The progress bar grows in discrete, visible blocks.
+@pbar:
+@fraction:
+
+
+<!-- ##### FUNCTION gtk_progress_bar_get_pulse_step ##### -->
+<para>
+
+</para>
+
+@pbar:
+@Returns:
+
@columns: The new number of columns.
+<!-- ##### FUNCTION gtk_table_get_size ##### -->
+<para>
+
+</para>
+
+@table:
+@rows:
+@columns:
+
+
<!-- ##### FUNCTION gtk_table_attach ##### -->
<para>
Adds a widget to a table. The number of 'cells' that a widget will occupy is
@Returns:
+<!-- ##### FUNCTION gtk_window_group_get_current_grab ##### -->
+<para>
+
+</para>
+
+@window_group:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_window_group_get_current_device_grab ##### -->
<para>
gdkpixmap.h \
gdkprivate.h \
gdkproperty.h \
- gdkregion.h \
gdkrgb.h \
gdkscreen.h \
gdkselection.h \
gdkinternals.h \
gdkdeviceprivate.h \
gdkintl.h \
- gdkpoly-generic.h \
- gdkregion-generic.h
+ gdkpoly-generic.h
gdk_c_sources = \
$(medialib_sources) \
gdkpixbuf-drawable.c \
gdkpixbuf-render.c \
gdkpixmap.c \
- gdkpolyreg-generic.c \
gdkrectangle.c \
- gdkregion-generic.c \
gdkrgb.c \
gdkscreen.c \
gdkselection.c \
#include <gdk/gdkpixbuf.h>
#include <gdk/gdkpixmap.h>
#include <gdk/gdkproperty.h>
-#include <gdk/gdkregion.h>
#include <gdk/gdkrgb.h>
#include <gdk/gdkscreen.h>
#include <gdk/gdkselection.h>
gdk_event_mask_get_type G_GNUC_CONST
gdk_event_type_get_type G_GNUC_CONST
gdk_fill_get_type G_GNUC_CONST
-gdk_fill_rule_get_type G_GNUC_CONST
gdk_filter_return_get_type G_GNUC_CONST
gdk_function_get_type G_GNUC_CONST
gdk_grab_ownership_get_type G_GNUC_CONST
gdk_line_style_get_type G_GNUC_CONST
gdk_modifier_type_get_type G_GNUC_CONST
gdk_notify_type_get_type G_GNUC_CONST
-gdk_overlap_type_get_type G_GNUC_CONST
gdk_owner_change_get_type G_GNUC_CONST
gdk_property_state_get_type G_GNUC_CONST
gdk_prop_mode_get_type G_GNUC_CONST
#endif
#endif
-#if IN_HEADER(__GDK_REGION_H__)
-#if IN_FILE(__GDK_REGION_GENERIC_C__)
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_region_copy
-gdk_region_destroy
-gdk_region_empty
-gdk_region_equal
-gdk_region_rect_equal
-gdk_region_get_clipbox
-gdk_region_get_rectangles
-gdk_region_intersect
-gdk_region_new
-gdk_region_offset
-gdk_region_point_in
-gdk_region_rectangle
-gdk_region_rect_in
-gdk_region_shrink
-gdk_region_spans_intersect_foreach
-gdk_region_subtract
-gdk_region_union
-gdk_region_union_with_rect
-gdk_region_xor
-#endif
-#endif
-#endif
-
-#if IN_HEADER(__GDK_REGION_H__)
-#if IN_FILE(__GDK_POLYREG_GENERIC_C__)
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_region_polygon
-#endif
-#endif
-#endif
-
#if IN_HEADER(__GDK_RGB_H__)
#if IN_FILE(__GDK_RGB_C__)
gdk_rgb_cmap_free
+++ /dev/null
-/* $TOG: PolyReg.c /main/15 1998/02/06 17:47:08 kaleb $ */
-/************************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-All Rights Reserved.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-************************************************************************/
-/* $XFree86: xc/lib/X11/PolyReg.c,v 1.4 1998/10/03 08:41:21 dawes Exp $ */
-
-#define LARGE_COORDINATE 1000000
-#define SMALL_COORDINATE -LARGE_COORDINATE
-
-#include "config.h"
-#include <gdkregion.h>
-#include "gdkregion-generic.h"
-#include "gdkpoly-generic.h"
-#include "gdkalias.h"
-
-/*
- * InsertEdgeInET
- *
- * Insert the given edge into the edge table.
- * First we must find the correct bucket in the
- * Edge table, then find the right slot in the
- * bucket. Finally, we can insert it.
- *
- */
-static void
-InsertEdgeInET (EdgeTable *ET,
- EdgeTableEntry *ETE,
- int scanline,
- ScanLineListBlock **SLLBlock,
- int *iSLLBlock)
-{
- EdgeTableEntry *start, *prev;
- ScanLineList *pSLL, *pPrevSLL;
- ScanLineListBlock *tmpSLLBlock;
-
- /*
- * find the right bucket to put the edge into
- */
- pPrevSLL = &ET->scanlines;
- pSLL = pPrevSLL->next;
- while (pSLL && (pSLL->scanline < scanline))
- {
- pPrevSLL = pSLL;
- pSLL = pSLL->next;
- }
-
- /*
- * reassign pSLL (pointer to ScanLineList) if necessary
- */
- if ((!pSLL) || (pSLL->scanline > scanline))
- {
- if (*iSLLBlock > SLLSPERBLOCK-1)
- {
- tmpSLLBlock =
- (ScanLineListBlock *)g_malloc(sizeof(ScanLineListBlock));
- (*SLLBlock)->next = tmpSLLBlock;
- tmpSLLBlock->next = (ScanLineListBlock *)NULL;
- *SLLBlock = tmpSLLBlock;
- *iSLLBlock = 0;
- }
- pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
-
- pSLL->next = pPrevSLL->next;
- pSLL->edgelist = (EdgeTableEntry *)NULL;
- pPrevSLL->next = pSLL;
- }
- pSLL->scanline = scanline;
-
- /*
- * now insert the edge in the right bucket
- */
- prev = (EdgeTableEntry *)NULL;
- start = pSLL->edgelist;
- while (start && (start->bres.minor_axis < ETE->bres.minor_axis))
- {
- prev = start;
- start = start->next;
- }
- ETE->next = start;
-
- if (prev)
- prev->next = ETE;
- else
- pSLL->edgelist = ETE;
-}
-\f
-/*
- * CreateEdgeTable
- *
- * This routine creates the edge table for
- * scan converting polygons.
- * The Edge Table (ET) looks like:
- *
- * EdgeTable
- * --------
- * | ymax | ScanLineLists
- * |scanline|-->------------>-------------->...
- * -------- |scanline| |scanline|
- * |edgelist| |edgelist|
- * --------- ---------
- * | |
- * | |
- * V V
- * list of ETEs list of ETEs
- *
- * where ETE is an EdgeTableEntry data structure,
- * and there is one ScanLineList per scanline at
- * which an edge is initially entered.
- *
- */
-
-static void
-CreateETandAET (int count,
- const GdkPoint *pts,
- EdgeTable *ET,
- EdgeTableEntry *AET,
- EdgeTableEntry *pETEs,
- ScanLineListBlock *pSLLBlock)
-{
- const GdkPoint *top, *bottom;
- const GdkPoint *PrevPt, *CurrPt;
- int iSLLBlock = 0;
- int dy;
-
- if (count < 2) return;
-
- /*
- * initialize the Active Edge Table
- */
- AET->next = (EdgeTableEntry *)NULL;
- AET->back = (EdgeTableEntry *)NULL;
- AET->nextWETE = (EdgeTableEntry *)NULL;
- AET->bres.minor_axis = SMALL_COORDINATE;
-
- /*
- * initialize the Edge Table.
- */
- ET->scanlines.next = (ScanLineList *)NULL;
- ET->ymax = SMALL_COORDINATE;
- ET->ymin = LARGE_COORDINATE;
- pSLLBlock->next = (ScanLineListBlock *)NULL;
-
- PrevPt = &pts[count-1];
-
- /*
- * for each vertex in the array of points.
- * In this loop we are dealing with two vertices at
- * a time -- these make up one edge of the polygon.
- */
- while (count--)
- {
- CurrPt = pts++;
-
- /*
- * find out which point is above and which is below.
- */
- if (PrevPt->y > CurrPt->y)
- {
- bottom = PrevPt, top = CurrPt;
- pETEs->ClockWise = 0;
- }
- else
- {
- bottom = CurrPt, top = PrevPt;
- pETEs->ClockWise = 1;
- }
-
- /*
- * don't add horizontal edges to the Edge table.
- */
- if (bottom->y != top->y)
- {
- pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
-
- /*
- * initialize integer edge algorithm
- */
- dy = bottom->y - top->y;
- BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
-
- InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock);
-
- if (PrevPt->y > ET->ymax)
- ET->ymax = PrevPt->y;
- if (PrevPt->y < ET->ymin)
- ET->ymin = PrevPt->y;
- pETEs++;
- }
-
- PrevPt = CurrPt;
- }
-}
-\f
-/*
- * loadAET
- *
- * This routine moves EdgeTableEntries from the
- * EdgeTable into the Active Edge Table,
- * leaving them sorted by smaller x coordinate.
- *
- */
-
-static void
-loadAET(EdgeTableEntry *AET,
- EdgeTableEntry *ETEs)
-{
- EdgeTableEntry *pPrevAET;
- EdgeTableEntry *tmp;
-
- pPrevAET = AET;
- AET = AET->next;
- while (ETEs)
- {
- while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis))
- {
- pPrevAET = AET;
- AET = AET->next;
- }
- tmp = ETEs->next;
- ETEs->next = AET;
- if (AET)
- AET->back = ETEs;
- ETEs->back = pPrevAET;
- pPrevAET->next = ETEs;
- pPrevAET = ETEs;
-
- ETEs = tmp;
- }
-}
-\f
-/*
- * computeWAET
- *
- * This routine links the AET by the
- * nextWETE (winding EdgeTableEntry) link for
- * use by the winding number rule. The final
- * Active Edge Table (AET) might look something
- * like:
- *
- * AET
- * ---------- --------- ---------
- * |ymax | |ymax | |ymax |
- * | ... | |... | |... |
- * |next |->|next |->|next |->...
- * |nextWETE| |nextWETE| |nextWETE|
- * --------- --------- ^--------
- * | | |
- * V-------------------> V---> ...
- *
- */
-static void
-computeWAET (EdgeTableEntry *AET)
-{
- EdgeTableEntry *pWETE;
- int inside = 1;
- int isInside = 0;
-
- AET->nextWETE = (EdgeTableEntry *)NULL;
- pWETE = AET;
- AET = AET->next;
- while (AET)
- {
- if (AET->ClockWise)
- isInside++;
- else
- isInside--;
-
- if ((!inside && !isInside) ||
- ( inside && isInside))
- {
- pWETE->nextWETE = AET;
- pWETE = AET;
- inside = !inside;
- }
- AET = AET->next;
- }
- pWETE->nextWETE = (EdgeTableEntry *)NULL;
-}
-\f
-/*
- * InsertionSort
- *
- * Just a simple insertion sort using
- * pointers and back pointers to sort the Active
- * Edge Table.
- *
- */
-
-static int
-InsertionSort (EdgeTableEntry *AET)
-{
- EdgeTableEntry *pETEchase;
- EdgeTableEntry *pETEinsert;
- EdgeTableEntry *pETEchaseBackTMP;
- int changed = 0;
-
- AET = AET->next;
- while (AET)
- {
- pETEinsert = AET;
- pETEchase = AET;
- while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis)
- pETEchase = pETEchase->back;
-
- AET = AET->next;
- if (pETEchase != pETEinsert)
- {
- pETEchaseBackTMP = pETEchase->back;
- pETEinsert->back->next = AET;
- if (AET)
- AET->back = pETEinsert->back;
- pETEinsert->next = pETEchase;
- pETEchase->back->next = pETEinsert;
- pETEchase->back = pETEinsert;
- pETEinsert->back = pETEchaseBackTMP;
- changed = 1;
- }
- }
- return(changed);
-}
-\f
-/*
- * Clean up our act.
- */
-static void
-FreeStorage (ScanLineListBlock *pSLLBlock)
-{
- ScanLineListBlock *tmpSLLBlock;
-
- while (pSLLBlock)
- {
- tmpSLLBlock = pSLLBlock->next;
- g_free (pSLLBlock);
- pSLLBlock = tmpSLLBlock;
- }
-}
-
-/*
- * Create an array of rectangles from a list of points.
- * If indeed these things (POINTS, RECTS) are the same,
- * then this proc is still needed, because it allocates
- * storage for the array, which was allocated on the
- * stack by the calling procedure.
- *
- */
-static cairo_region_t *
-PtsToRegion (int numFullPtBlocks,
- int iCurPtBlock,
- POINTBLOCK *FirstPtBlock)
-{
- GdkRectangle *rects, *allRects;
- GdkPoint *pts;
- POINTBLOCK *CurPtBlock;
- int i;
- int numRects;
- cairo_region_t *region;
-
- numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
-
- allRects = g_new (GdkRectangle, numRects);
-
- CurPtBlock = FirstPtBlock;
- rects = allRects - 1;
- numRects = 0;
-
- for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) {
- /* the loop uses 2 points per iteration */
- i = NUMPTSTOBUFFER >> 1;
- if (!numFullPtBlocks)
- i = iCurPtBlock >> 1;
- for (pts = CurPtBlock->pts; i--; pts += 2) {
- if (pts->x == pts[1].x)
- continue;
- if (numRects && pts->x == rects->x && pts->y == rects->y + rects->height &&
- pts[1].x == rects->x + rects->width &&
- (numRects == 1 || rects[-1].y != rects->y) &&
- (i && pts[2].y > pts[1].y)) {
- rects->height = pts[1].y + 1 - rects->y;
- continue;
- }
- numRects++;
- rects++;
- rects->x = pts->x; rects->y = pts->y;
- rects->width = pts[1].x - rects->x; rects->height = pts[1].y + 1 - rects->y;
- }
- CurPtBlock = CurPtBlock->next;
- }
-
- region = cairo_region_create_rectangles (allRects, numRects);
- g_free (allRects);
- return region;
-}
-
-/**
- * gdk_region_polygon:
- * @points: an array of #GdkPoint structs
- * @n_points: the number of elements in the @points array
- * @fill_rule: specifies which pixels are included in the region when the
- * polygon overlaps itself.
- *
- * Creates a new #GdkRegion using the polygon defined by a
- * number of points.
- *
- * Returns: a new #GdkRegion based on the given polygon
- */
-GdkRegion *
-gdk_region_polygon (const GdkPoint *points,
- gint n_points,
- GdkFillRule fill_rule)
-{
- GdkRegion *region;
- EdgeTableEntry *pAET; /* Active Edge Table */
- int y; /* current scanline */
- int iPts = 0; /* number of pts in buffer */
- EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/
- ScanLineList *pSLL; /* current scanLineList */
- GdkPoint *pts; /* output buffer */
- EdgeTableEntry *pPrevAET; /* ptr to previous AET */
- EdgeTable ET; /* header node for ET */
- EdgeTableEntry AET; /* header node for AET */
- EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
- ScanLineListBlock SLLBlock; /* header for scanlinelist */
- int fixWAET = FALSE;
- POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
- POINTBLOCK *tmpPtBlock;
- int numFullPtBlocks = 0;
-
- /* special case a rectangle */
- if (((n_points == 4) ||
- ((n_points == 5) && (points[4].x == points[0].x) && (points[4].y == points[0].y))) &&
- (((points[0].y == points[1].y) &&
- (points[1].x == points[2].x) &&
- (points[2].y == points[3].y) &&
- (points[3].x == points[0].x)) ||
- ((points[0].x == points[1].x) &&
- (points[1].y == points[2].y) &&
- (points[2].x == points[3].x) &&
- (points[3].y == points[0].y)))) {
- GdkRectangle extents;
-
- extents.x = MIN(points[0].x, points[2].x);
- extents.y = MIN(points[0].y, points[2].y);
- extents.width = MAX(points[0].x, points[2].x) - extents.x;
- extents.height = MAX(points[0].y, points[2].y) - extents.y;
- return cairo_region_create_rectangle (&extents);
- }
-
- pETEs = g_new (EdgeTableEntry, n_points);
-
- pts = FirstPtBlock.pts;
- CreateETandAET(n_points, points, &ET, &AET, pETEs, &SLLBlock);
- pSLL = ET.scanlines.next;
- curPtBlock = &FirstPtBlock;
-
- if (fill_rule == GDK_EVEN_ODD_RULE) {
- /*
- * for each scanline
- */
- for (y = ET.ymin; y < ET.ymax; y++) {
- /*
- * Add a new edge to the active edge table when we
- * get to the next edge.
- */
- if (pSLL != NULL && y == pSLL->scanline) {
- loadAET(&AET, pSLL->edgelist);
- pSLL = pSLL->next;
- }
- pPrevAET = &AET;
- pAET = AET.next;
-
- /*
- * for each active edge
- */
- while (pAET) {
- pts->x = pAET->bres.minor_axis, pts->y = y;
- pts++, iPts++;
-
- /*
- * send out the buffer
- */
- if (iPts == NUMPTSTOBUFFER) {
- tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
- tmpPtBlock->next = NULL;
- curPtBlock->next = tmpPtBlock;
- curPtBlock = tmpPtBlock;
- pts = curPtBlock->pts;
- numFullPtBlocks++;
- iPts = 0;
- }
- EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
- }
- (void) InsertionSort(&AET);
- }
- }
- else {
- /*
- * for each scanline
- */
- for (y = ET.ymin; y < ET.ymax; y++) {
- /*
- * Add a new edge to the active edge table when we
- * get to the next edge.
- */
- if (pSLL != NULL && y == pSLL->scanline) {
- loadAET(&AET, pSLL->edgelist);
- computeWAET(&AET);
- pSLL = pSLL->next;
- }
- pPrevAET = &AET;
- pAET = AET.next;
- pWETE = pAET;
-
- /*
- * for each active edge
- */
- while (pAET) {
- /*
- * add to the buffer only those edges that
- * are in the Winding active edge table.
- */
- if (pWETE == pAET) {
- pts->x = pAET->bres.minor_axis, pts->y = y;
- pts++, iPts++;
-
- /*
- * send out the buffer
- */
- if (iPts == NUMPTSTOBUFFER) {
- tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
- tmpPtBlock->next = NULL;
- curPtBlock->next = tmpPtBlock;
- curPtBlock = tmpPtBlock;
- pts = curPtBlock->pts;
- numFullPtBlocks++; iPts = 0;
- }
- pWETE = pWETE->nextWETE;
- }
- EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
- }
-
- /*
- * recompute the winding active edge table if
- * we just resorted or have exited an edge.
- */
- if (InsertionSort(&AET) || fixWAET) {
- computeWAET(&AET);
- fixWAET = FALSE;
- }
- }
- }
- FreeStorage(SLLBlock.next);
- region = PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock);
- for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
- tmpPtBlock = curPtBlock->next;
- g_free (curPtBlock);
- curPtBlock = tmpPtBlock;
- }
- g_free (pETEs);
- return(region);
-}
-
-#define __GDK_POLYREG_GENERIC_C__
-#include "gdkaliasdef.c"
+++ /dev/null
-#include "config.h"
-#include <stdlib.h>
-#include <string.h>
-#include <gdkregion.h>
-#include "gdkalias.h"
-
-/**
- * gdk_region_new:
- *
- * Creates a new empty #GdkRegion.
- *
- * Returns: a new empty #GdkRegion
- *
- * Deprecated: 2.22: Use cairo_region_create() instead.
- */
-GdkRegion *
-gdk_region_new (void)
-{
- return cairo_region_create ();
-}
-
-/**
- * gdk_region_rectangle:
- * @rectangle: a #GdkRectangle
- *
- * Creates a new region containing the area @rectangle.
- *
- * Return value: a new region
- *
- * Deprecated: 2.22: Use cairo_region_create_rectangle()
- **/
-GdkRegion *
-gdk_region_rectangle (const GdkRectangle *rectangle)
-{
- g_return_val_if_fail (rectangle != NULL, NULL);
-
- if (rectangle->width <= 0 || rectangle->height <= 0)
- return gdk_region_new();
-
- return cairo_region_create_rectangle (rectangle);
-}
-
-/**
- * gdk_region_copy:
- * @region: a #GdkRegion
- *
- * Copies @region, creating an identical new region.
- *
- * Return value: a new region identical to @region
- *
- * Deprecated: 2.22: Use cairo_region_copy()
- **/
-GdkRegion *
-gdk_region_copy (const GdkRegion *region)
-{
- return cairo_region_copy (region);
-}
-
-/**
- * gdk_region_get_clipbox:
- * @region: a #GdkRegion
- * @rectangle: return location for the clipbox
- *
- * Obtains the smallest rectangle which includes the entire #GdkRegion.
- *
- * Deprecated: 2.22: Use cairo_region_get_extents()
- */
-void
-gdk_region_get_clipbox (const GdkRegion *region,
- GdkRectangle *rectangle)
-{
- g_return_if_fail (region != NULL);
- g_return_if_fail (rectangle != NULL);
-
- cairo_region_get_extents (region, rectangle);
-}
-
-
-/**
- * gdk_region_get_rectangles:
- * @region: a #GdkRegion
- * @rectangles: (array length=n_rectangles) (transfer container): return location for an array of rectangles
- * @n_rectangles: length of returned array
- *
- * Obtains the area covered by the region as a list of rectangles.
- * The array returned in @rectangles must be freed with g_free().
- *
- * Deprecated: 2.22: Use cairo_region_num_rectangles() and cairo_region_get_rectangle() instead.
- **/
-void
-gdk_region_get_rectangles (const GdkRegion *region,
- GdkRectangle **rectangles,
- gint *n_rectangles)
-{
- gint i, n;
- GdkRectangle *rects;
-
- g_return_if_fail (region != NULL);
- g_return_if_fail (rectangles != NULL);
- g_return_if_fail (n_rectangles != NULL);
-
- n = cairo_region_num_rectangles (region);
- rects = g_new (GdkRectangle, n);
-
- for (i = 0; i < n; i++)
- {
- cairo_region_get_rectangle (region, i, &rects[i]);
- }
-
- *n_rectangles = n;
- *rectangles = rects;
-}
-
-/**
- * gdk_region_union_with_rect:
- * @region: a #GdkRegion.
- * @rect: a #GdkRectangle.
- *
- * Sets the area of @region to the union of the areas of @region and
- * @rect. The resulting area is the set of pixels contained in
- * either @region or @rect.
- *
- * Deprecated: 2.22: Use cairo_region_union_rectangle() instead.
- **/
-void
-gdk_region_union_with_rect (GdkRegion *region,
- const GdkRectangle *rect)
-{
- g_return_if_fail (region != NULL);
- g_return_if_fail (rect != NULL);
-
- if (rect->width <= 0 || rect->height <= 0)
- return;
-
- cairo_region_union_rectangle (region, rect);
-}
-
-/**
- * gdk_region_destroy:
- * @region: a #GdkRegion
- *
- * Destroys a #GdkRegion.
- *
- * Deprecated: 2.22: Use cairo_region_destroy() instead.
- */
-void
-gdk_region_destroy (GdkRegion *region)
-{
- g_return_if_fail (region != NULL);
-
- cairo_region_destroy (region);
-}
-
-
-/**
- * gdk_region_offset:
- * @region: a #GdkRegion
- * @dx: the distance to move the region horizontally
- * @dy: the distance to move the region vertically
- *
- * Moves a region the specified distance.
- *
- * Deprecated: 2.22: Use cairo_region_translate() instead.
- */
-void
-gdk_region_offset (GdkRegion *region,
- gint x,
- gint y)
-{
- cairo_region_translate (region, x, y);
-}
-
-/**
- * gdk_region_shrink:
- * @region: a #GdkRegion
- * @dx: the number of pixels to shrink the region horizontally
- * @dy: the number of pixels to shrink the region vertically
- *
- * Resizes a region by the specified amount.
- * Positive values shrink the region. Negative values expand it.
- *
- * Deprecated: 2.22: There is no replacement for this function.
- */
-void
-gdk_region_shrink (GdkRegion *region,
- int dx,
- int dy)
-{
- GdkRectangle *rects;
- int i, n_rects;
-
- gdk_region_get_rectangles (region, &rects, &n_rects);
- /* clear region */
- gdk_region_subtract (region, region);
-
- for (i = 0; i < n_rects; i++)
- {
- if (rects[i].width <= 2 * dx ||
- rects[i].height <= 2 * dy)
- continue;
-
- rects[i].x += dx;
- rects[i].y += dy;
- rects[i].width -= 2 * dx;
- rects[i].height -= 2 * dy;
- cairo_region_union_rectangle (region, &rects[i]);
- }
-}
-
-/**
- * gdk_region_intersect:
- * @source1: a #GdkRegion
- * @source2: another #GdkRegion
- *
- * Sets the area of @source1 to the intersection of the areas of @source1
- * and @source2. The resulting area is the set of pixels contained in
- * both @source1 and @source2.
- *
- * Deprecated: 2.22: Use cairo_region_intersect() instead.
- **/
-void
-gdk_region_intersect (GdkRegion *source1,
- const GdkRegion *source2)
-{
- g_return_if_fail (source1 != NULL);
- g_return_if_fail (source2 != NULL);
-
- cairo_region_intersect (source1, (cairo_region_t *) source2);
-}
-
-/**
- * gdk_region_union:
- * @source1: a #GdkRegion
- * @source2: a #GdkRegion
- *
- * Sets the area of @source1 to the union of the areas of @source1 and
- * @source2. The resulting area is the set of pixels contained in
- * either @source1 or @source2.
- *
- * Deprecated: 2.22: Use cairo_region_union() instead.
- **/
-void
-gdk_region_union (GdkRegion *source1,
- const GdkRegion *source2)
-{
- g_return_if_fail (source1 != NULL);
- g_return_if_fail (source2 != NULL);
-
- cairo_region_union (source1, (cairo_region_t *) source2);
-}
-
-/**
- * gdk_region_subtract:
- * @source1: a #GdkRegion
- * @source2: another #GdkRegion
- *
- * Subtracts the area of @source2 from the area @source1. The resulting
- * area is the set of pixels contained in @source1 but not in @source2.
- *
- * Deprecated: 2.22: Use cairo_region_subtract() instead.
- **/
-void
-gdk_region_subtract (GdkRegion *source1,
- const GdkRegion *source2)
-{
- g_return_if_fail (source1 != NULL);
- g_return_if_fail (source2 != NULL);
-
- cairo_region_subtract (source1, source2);
-}
-
-/**
- * gdk_region_xor:
- * @source1: a #GdkRegion
- * @source2: another #GdkRegion
- *
- * Sets the area of @source1 to the exclusive-OR of the areas of @source1
- * and @source2. The resulting area is the set of pixels contained in one
- * or the other of the two sources but not in both.
- *
- * Deprecated: 2.22: There is no replacement, but the function can be
- * reimplemented using cairo_region_intersect() and
- * cairo_region_subract() easily.
- **/
-void
-gdk_region_xor (GdkRegion *source1,
- const GdkRegion *source2)
-{
- GdkRegion *trb;
-
- g_return_if_fail (source1 != NULL);
- g_return_if_fail (source2 != NULL);
-
- trb = gdk_region_copy (source2);
-
- gdk_region_subtract (trb, source1);
- gdk_region_subtract (source1, source2);
-
- gdk_region_union (source1, trb);
-
- gdk_region_destroy (trb);
-}
-
-/**
- * gdk_region_empty:
- * @region: a #GdkRegion
- *
- * Finds out if the #GdkRegion is empty.
- *
- * Returns: %TRUE if @region is empty.
- *
- * Deprecated: 2.22: Use cairo_region_is_empty() instead.
- */
-gboolean
-gdk_region_empty (const GdkRegion *region)
-{
- g_return_val_if_fail (region != NULL, FALSE);
-
- return cairo_region_is_empty (region);
-}
-
-/**
- * gdk_region_equal:
- * @region1: a #GdkRegion
- * @region2: a #GdkRegion
- *
- * Finds out if the two regions are the same.
- *
- * Returns: %TRUE if @region1 and @region2 are equal.
- *
- * Deprecated: 2.22: Use cairo_region_equal() instead.
- */
-gboolean
-gdk_region_equal (const GdkRegion *region1,
- const GdkRegion *region2)
-{
- g_return_val_if_fail (region1 != NULL, FALSE);
- g_return_val_if_fail (region2 != NULL, FALSE);
-
- return cairo_region_equal (region1, region2);
-}
-
-/**
- * gdk_region_rect_equal:
- * @region: a #GdkRegion
- * @rectangle: a #GdkRectangle
- *
- * Finds out if a regions is the same as a rectangle.
- *
- * Returns: %TRUE if @region and @rectangle are equal.
- *
- * Since: 2.18
- */
-gboolean
-gdk_region_rect_equal (const GdkRegion *region,
- const GdkRectangle *rectangle)
-{
- cairo_rectangle_int_t extents;
-
- g_return_val_if_fail (region != NULL, FALSE);
- g_return_val_if_fail (rectangle != NULL, FALSE);
-
- if (cairo_region_num_rectangles (region) != 1) return FALSE;
- cairo_region_get_extents (region, &extents);
- if (extents.x != rectangle->x) return FALSE;
- else if (extents.y != rectangle->y) return FALSE;
- else if (extents.width != rectangle->width) return FALSE;
- else if (extents.height != rectangle->height) return FALSE;
- return TRUE;
-}
-
-/**
- * gdk_region_point_in:
- * @region: a #GdkRegion
- * @x: the x coordinate of a point
- * @y: the y coordinate of a point
- *
- * Finds out if a point is in a region.
- *
- * Returns: %TRUE if the point is in @region.
- *
- * Deprecated: 2.22: Use cairo_region_contains_point() instead.
- */
-gboolean
-gdk_region_point_in (const GdkRegion *region,
- int x,
- int y)
-{
- g_return_val_if_fail (region != NULL, FALSE);
-
- return cairo_region_contains_point (region, x, y);
-}
-
-/**
- * gdk_region_rect_in:
- * @region: a #GdkRegion.
- * @rectangle: a #GdkRectangle.
- *
- * Tests whether a rectangle is within a region.
- *
- * Returns: %GDK_OVERLAP_RECTANGLE_IN, %GDK_OVERLAP_RECTANGLE_OUT, or
- * %GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside,
- * outside, or partly inside the #GdkRegion, respectively.
- *
- * Deprecated: 2.22: Use cairo_region_contains_rectangle() instead.
- */
-GdkOverlapType
-gdk_region_rect_in (const GdkRegion *region,
- const GdkRectangle *rectangle)
-{
- g_return_val_if_fail (region != NULL, GDK_OVERLAP_RECTANGLE_OUT);
- g_return_val_if_fail (rectangle != NULL, GDK_OVERLAP_RECTANGLE_OUT);
-
- return cairo_region_contains_rectangle (region, rectangle);
-}
-
-
-static void
-gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region,
- const GdkSpan *spans,
- int n_spans,
- GdkSpanFunc function,
- gpointer data)
-{
- gint i, j, left, right, y, n_rects;
- gint clipped_left, clipped_right;
- cairo_rectangle_int_t pbox, extents;
-
- n_rects = cairo_region_num_rectangles (region);
- if (!n_rects)
- return;
-
- cairo_region_get_extents (region, &extents);
- for (i=0;i<n_spans;i++)
- {
- y = spans[i].y;
- left = spans[i].x;
- right = left + spans[i].width; /* right is not in the span! */
-
- if (! ((extents.y <= y) &&
- (extents.y + extents.height > y) &&
- (extents.x < right) &&
- (extents.x + extents.width > left)) )
- continue;
-
- /* can stop when we passed y */
- for (j = 0; j < n_rects; j++)
- {
- cairo_region_get_rectangle (region, j, &pbox);
-
- if (pbox.y + pbox.height <= y)
- continue; /* Not quite there yet */
-
- if (pbox.y > y)
- break; /* passed the spanline */
-
- if ((right > pbox.x) && (left < pbox.x + pbox.width))
- {
- GdkSpan out_span;
-
- clipped_left = MAX (left, pbox.x);
- clipped_right = MIN (right, pbox.x + pbox.width);
-
- out_span.y = y;
- out_span.x = clipped_left;
- out_span.width = clipped_right - clipped_left;
- (*function) (&out_span, data);
- }
- }
- }
-}
-
-/**
- * gdk_region_spans_intersect_foreach:
- * @region: a #GdkRegion
- * @spans: an array of #GdkSpans
- * @n_spans: the length of @spans
- * @sorted: %TRUE if @spans is sorted wrt. the y coordinate
- * @function: function to call on each span in the intersection
- * @data: data to pass to @function
- *
- * Calls a function on each span in the intersection of @region and @spans.
- *
- * Deprecated: 2.22: There is no replacement.
- */
-void
-gdk_region_spans_intersect_foreach (GdkRegion *region,
- const GdkSpan *spans,
- int n_spans,
- gboolean sorted,
- GdkSpanFunc function,
- gpointer data)
-{
- gint i, left, right, y, n_rects;
- gint clipped_left, clipped_right;
- GdkRectangle pbox;
- const GdkSpan *span, *tmpspan;
- const GdkSpan *end_span;
-
- g_return_if_fail (region != NULL);
- g_return_if_fail (spans != NULL);
-
- if (!sorted)
- {
- gdk_region_unsorted_spans_intersect_foreach (region,
- spans,
- n_spans,
- function,
- data);
- return;
- }
-
- n_rects = cairo_region_num_rectangles (region);
- if (n_rects == 0 || n_spans == 0)
- return;
-
- /* The main method here is to step along the
- * sorted rectangles and spans in lock step, and
- * clipping the spans that are in the current
- * rectangle before going on to the next rectangle.
- */
-
- span = spans;
- end_span = spans + n_spans;
- for (i = 0; i < n_rects; i++)
- {
- cairo_region_get_rectangle (region, i, &pbox);
-
- while ((pbox.y + pbox.height < span->y) || (span->y < pbox.y))
- {
- /* Skip any rectangles that are above the current span */
- if (pbox.y + pbox.height < span->y)
- {
- i++;
- if (i == n_rects)
- return;
- cairo_region_get_rectangle (region, i, &pbox);
- }
- /* Skip any spans that are above the current rectangle */
- if (span->y < pbox.y)
- {
- span++;
- if (span == end_span)
- return;
- }
- }
-
- /* Ok, we got at least one span that might intersect this rectangle. */
- tmpspan = span;
- while ((tmpspan < end_span) &&
- (tmpspan->y < pbox.y + pbox.height))
- {
- y = tmpspan->y;
- left = tmpspan->x;
- right = left + tmpspan->width; /* right is not in the span! */
-
- if ((right > pbox.x) && (left < pbox.x + pbox.width))
- {
- GdkSpan out_span;
-
- clipped_left = MAX (left, pbox.x);
- clipped_right = MIN (right, pbox.x + pbox.width);
-
- out_span.y = y;
- out_span.x = clipped_left;
- out_span.width = clipped_right - clipped_left;
- (*function) (&out_span, data);
- }
-
- tmpspan++;
- }
- }
-}
-
-#define __GDK_REGION_GENERIC_C__
-#include "gdkaliasdef.c"
+++ /dev/null
-/* $TOG: region.h /main/9 1998/02/06 17:50:30 kaleb $ */
-/************************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-All Rights Reserved.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-************************************************************************/
-
-#ifndef __GDK_REGION_GENERIC_H__
-#define __GDK_REGION_GENERIC_H__
-
-typedef GdkSegment GdkRegionBox;
-
-/*
- * clip region
- */
-
-struct _GdkRegion
-{
- long size;
- long numRects;
- GdkRegionBox *rects;
- GdkRegionBox extents;
-};
-
-/* 1 if two BOXs overlap.
- * 0 if two BOXs do not overlap.
- * Remember, x2 and y2 are not in the region
- */
-#define EXTENTCHECK(r1, r2) \
- ((r1)->x2 > (r2)->x1 && \
- (r1)->x1 < (r2)->x2 && \
- (r1)->y2 > (r2)->y1 && \
- (r1)->y1 < (r2)->y2)
-
-/*
- * update region extents
- */
-#define EXTENTS(r,idRect){\
- if((r)->x1 < (idRect)->extents.x1)\
- (idRect)->extents.x1 = (r)->x1;\
- if((r)->y1 < (idRect)->extents.y1)\
- (idRect)->extents.y1 = (r)->y1;\
- if((r)->x2 > (idRect)->extents.x2)\
- (idRect)->extents.x2 = (r)->x2;\
- if((r)->y2 > (idRect)->extents.y2)\
- (idRect)->extents.y2 = (r)->y2;\
- }
-
-#define GROWREGION(reg, nRects) { \
- if ((nRects) == 0) { \
- if ((reg)->rects != &(reg)->extents) { \
- g_free ((reg)->rects); \
- (reg)->rects = &(reg)->extents; \
- } \
- } \
- else if ((reg)->rects == &(reg)->extents) { \
- (reg)->rects = g_new (GdkRegionBox, (nRects)); \
- (reg)->rects[0] = (reg)->extents; \
- } \
- else \
- (reg)->rects = g_renew (GdkRegionBox, (reg)->rects, (nRects)); \
- (reg)->size = (nRects); \
- }
-
-/*
- * Check to see if there is enough memory in the present region.
- */
-#define MEMCHECK(reg, rect, firstrect){ \
- if ((reg)->numRects >= ((reg)->size - 1)) { \
- GROWREGION(reg,2*(reg)->size); \
- (rect) = &(firstrect)[(reg)->numRects]; \
- } \
- }
-
-/* this routine checks to see if the previous rectangle is the same
- * or subsumes the new rectangle to add.
- */
-
-#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
- (!(((Reg)->numRects > 0)&&\
- ((R-1)->y1 == (Ry1)) &&\
- ((R-1)->y2 == (Ry2)) &&\
- ((R-1)->x1 <= (Rx1)) &&\
- ((R-1)->x2 >= (Rx2))))
-
-/* add a rectangle to the given Region */
-#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
- if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
- CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
- (r)->x1 = (rx1);\
- (r)->y1 = (ry1);\
- (r)->x2 = (rx2);\
- (r)->y2 = (ry2);\
- EXTENTS((r), (reg));\
- (reg)->numRects++;\
- (r)++;\
- }\
- }
-
-
-
-/* add a rectangle to the given Region */
-#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
- if ((rx1 < rx2) && (ry1 < ry2) &&\
- CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
- (r)->x1 = (rx1);\
- (r)->y1 = (ry1);\
- (r)->x2 = (rx2);\
- (r)->y2 = (ry2);\
- (reg)->numRects++;\
- (r)++;\
- }\
- }
-
-#define EMPTY_REGION(pReg) pReg->numRects = 0
-
-#define REGION_NOT_EMPTY(pReg) pReg->numRects
-
-#define INBOX(r, x, y) \
- ( ( ((r).x2 > x)) && \
- ( ((r).x1 <= x)) && \
- ( ((r).y2 > y)) && \
- ( ((r).y1 <= y)) )
-
-/*
- * number of points to buffer before sending them off
- * to scanlines() : Must be an even number
- */
-#define NUMPTSTOBUFFER 200
-
-/*
- * used to allocate buffers for points and link
- * the buffers together
- */
-typedef struct _POINTBLOCK {
- GdkPoint pts[NUMPTSTOBUFFER];
- struct _POINTBLOCK *next;
-} POINTBLOCK;
-
-#endif /* __GDK_REGION_GENERIC_H__ */
+++ /dev/null
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
-#error "Only <gdk/gdk.h> can be included directly."
-#endif
-
-#ifndef __GDK_REGION_H__
-#define __GDK_REGION_H__
-
-#include <gdk/gdktypes.h>
-
-G_BEGIN_DECLS
-
-/* GC fill rule for polygons
- * EvenOddRule
- * WindingRule
- */
-typedef enum
-{
- GDK_EVEN_ODD_RULE,
- GDK_WINDING_RULE
-} GdkFillRule;
-
-#ifndef GDK_DISABLE_DEPRECATED
-/* Types of overlapping between a rectangle and a region
- * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
- * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
- * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
- *
- * Deprecated: 2.22: Superceded by #cairo_region_overlap_t and
- * cairo_region_contains_rectangle().
- */
-typedef enum
-{
- GDK_OVERLAP_RECTANGLE_IN,
- GDK_OVERLAP_RECTANGLE_OUT,
- GDK_OVERLAP_RECTANGLE_PART
-} GdkOverlapType;
-
-typedef void (* GdkSpanFunc) (GdkSpan *span,
- gpointer data);
-
-GdkRegion * gdk_region_new (void);
-#endif
-cairo_region_t * gdk_region_polygon (const GdkPoint *points,
- gint n_points,
- GdkFillRule fill_rule);
-#ifndef GDK_DISABLE_DEPRECATED
-GdkRegion * gdk_region_copy (const GdkRegion *region);
-GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle);
-void gdk_region_destroy (GdkRegion *region);
-
-void gdk_region_get_clipbox (const GdkRegion *region,
- GdkRectangle *rectangle);
-void gdk_region_get_rectangles (const GdkRegion *region,
- GdkRectangle **rectangles,
- gint *n_rectangles);
-
-gboolean gdk_region_empty (const GdkRegion *region);
-gboolean gdk_region_equal (const GdkRegion *region1,
- const GdkRegion *region2);
-#endif
-gboolean gdk_region_rect_equal (const cairo_region_t *region,
- const GdkRectangle *rectangle);
-#ifndef GDK_DISABLE_DEPRECATED
-gboolean gdk_region_point_in (const GdkRegion *region,
- int x,
- int y);
-GdkOverlapType gdk_region_rect_in (const GdkRegion *region,
- const GdkRectangle *rectangle);
-
-void gdk_region_offset (GdkRegion *region,
- gint dx,
- gint dy);
-void gdk_region_shrink (GdkRegion *region,
- gint dx,
- gint dy);
-void gdk_region_union_with_rect (GdkRegion *region,
- const GdkRectangle *rect);
-void gdk_region_intersect (GdkRegion *source1,
- const GdkRegion *source2);
-void gdk_region_union (GdkRegion *source1,
- const GdkRegion *source2);
-void gdk_region_subtract (GdkRegion *source1,
- const GdkRegion *source2);
-void gdk_region_xor (GdkRegion *source1,
- const GdkRegion *source2);
-
-void gdk_region_spans_intersect_foreach (GdkRegion *region,
- const GdkSpan *spans,
- int n_spans,
- gboolean sorted,
- GdkSpanFunc function,
- gpointer data);
-#endif
-
-G_END_DECLS
-
-#endif /* __GDK_REGION_H__ */
-
typedef struct _GdkCursor GdkCursor;
typedef struct _GdkGC GdkGC;
typedef struct _GdkImage GdkImage;
-#ifndef GDK_DISABLE_DEPRECATED
-typedef cairo_region_t GdkRegion;
-#endif
typedef struct _GdkVisual GdkVisual;
typedef struct _GdkDrawable GdkDrawable;
gint y;
};
-#ifndef GDK_DISABLE_DEPRECATED
-struct _GdkRectangle
-{
- gint x;
- gint y;
- gint width;
- gint height;
-};
-#endif
-
struct _GdkSegment
{
gint x1;
gdkpixbuf-drawable.obj \
gdkpixbuf-render.obj \
gdkpixmap.obj \
- gdkpolyreg-generic.obj \
gdkrectangle.obj \
- gdkregion-generic.obj \
gdkrgb.obj \
gdkscreen.obj \
gdkselection.obj \
gdkpixbuf.h \
gdkpixmap.h \
gdkproperty.h \
- gdkregion.h \
gdkrgb.h \
gdkselection.h \
gdktypes.h \